<% posts = get_category_posts( @category.id ) %>
<span class="category"><%= @category.name %></span>

<span class=create_post_button><%= link_to("Create Post", new_post_path(@category.id), :class=>"button")  %></span>
<ul class="cat_ul">
  <li><span class="cat_forum_header">Post</span><span class=cat_date>Date</span><span class="cat_forum_user_header">Created By</span><span class="cat_forum_user_header">Last Reply</span></li>
  <% posts.each do |p| %>
    <% if !p.last_reply_id.nil?
      last_replier = get_user_name(p.last_reply_id)
    else
    last_replier = "None"
  end %>
    <li><span class="cat_forum"><%= link_to( (is_sticky(p.id) ? "[s] " : "") + p.title, show_post_path(p.id)) %></span><span class="cat_date"><%= (((p.updated_at.nil?) ? p.created_at : p.updated_at).localtime).strftime("%b. %d, %Y -- %I:%M %p") %></span><span class="cat_forum_user"><%= link_to(p.user.name, show_user_path(p.user_id)) %></span><span class="cat_forum_user"><%= link_to(last_replier, show_user_path(p.last_reply_id)) %></span></li>
  <% end %>
</ul>
<span class=create_post_button><%= link_to("Create Post", new_post_path(@category.id), :class=>"button")  %></span>
